<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=+, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = [1,0,2,0,3,5,0,6,0,9,0];
        function remove0(arr,num){
            var newArr = [];
            for(var i = 0;i<arr.length;i++){
                if(arr[i] != num){
                    newArr.push(arr[i]);
                }
            }
            return newArr;
        }
        console.log(remove0(arr,0));
    </script>
</head>
<body>
    
</body>
</html>